home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Lib / test / test_sunaudiodev.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2000-06-23  |  945 b   |  27 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 1.5)
  3.  
  4. TestFailed
  5. import sunaudiodev
  6. import os
  7.  
  8. def play_sound_file(path):
  9.     fp = open(path, 'r')
  10.     data = fp.read()
  11.     fp.close()
  12.     
  13.     try:
  14.         a = sunaudiodev.open('w')
  15.     except sunaudiodev.error:
  16.         msg = None
  17.         raise TestFailed, msg
  18.  
  19.     a.write(data)
  20.     a.close()
  21.  
  22.  
  23. def test():
  24.     play_sound_file(findfile('audiotest.au'))
  25.  
  26. test()
  27.